package com.swotxu.oldwebproject.web.controller;

import com.swotxu.oldwebproject.web.pojo.WebResult;
import com.swotxu.oldwebproject.web.service.LoginService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 登陆入口
 *
 * @Date: 2019/12/16 21:53
 * @Author: swotXu
 */
@Controller
@RequestMapping("/index")
public class IndexController {
    private static final Logger log = LoggerFactory.getLogger(IndexController.class);
    @Autowired
    private LoginService loginService;

    @RequestMapping("/toIndex")
    public String toIndex(){
        log.info("/toIndex");
        return "modules/login/index";
    }

    @RequestMapping("/getUser")
    @ResponseBody
    public WebResult getUser(){
        log.info("/getUser");
        return loginService.getUser();
    }

}
